/**
 * Scripts para exibicao de dialog usando o dialog do jquery.ui
 */

/**
 * 
 * @param divId
 * @param titleModal
 * @param heightModal
 * @param widthModal
 */
function showModal( divId, title, height, width ){
	if(!height)
		height = $(window).height() * 0.95;
	if(!width)
		width = $(window).width() * 0.95;
	
	$( "#"+divId ).dialog({
		height: height,
		width: width,
		position: 'top',
		show: 'slide',
		modal: true,
		title: title,
		autoOpen: false //reuse dialog
		//buttons: { "Ok": function() { $(this).dialog("close"); } }
	});
	
	$( "#"+divId ).dialog('open');
}